var express = require('express');
var user= require('../dao/userDao');
var router = express.Router();
router.get("/openapi/*",function(req,res,next){
    console.log(req.body,"openapi-body1:");
    next();
});
router.get("/openapi/:id",async function(req,res){
    console.log(req.body,"openapi-body2:");
    const id=req.params.id;
    const result= await user.getOneById(id);
    console.log('结果:'+result)
    res.send({data:result});
    //res.render('index', { title: JSON.stringify(result) });
});
router.post("/openapi/addUser",async function(req,res){
    console.log(req.body,"body:");
    res.send({data:req.body});
})

module.exports = router;
